﻿<!-- #include file="mymin.asp" -->
<%
Function forAutoLine_(Str)
	If IsNull(str) Then Exit Function
	str=Trim(str)
	str=Replace(str,chr(13)&chr(10),"\\")
	' str=Replace(str,chr(13),"\\")
	forAutoLine_=str
End Function

Call head2()

w "<title>WAP2.0写文章</title></head><body>"

dim id,test,title,author,autoline
id=request.querystring("id")
test=request.form("test")
title=request.form("title")
author=request.form("author")
autoline=request.form("autoline")

if id="" or IsNumeric(id)=False then Call Error2("文章类别出错!")

if test="" or title="" or author="" then Call Error2("各项都不能为空")

If IsNumeric(author) Then Call error("来源不能是纯数字")

if len(title)>30 or len(author)>15 or len(test)>20000 then Call Error2("标题不要超过30字，来源不要超过15字，文章内容不要超过20000字，分多篇写。这有助于提高效率！")

if ifArticleRepeat(title) then Call error2("站内已存在同样标题的文章,请不要重复发表！")

if autoline=1 Then test=forAutoLine_(test)

dim rs
set rs=server.createobject("adodb.recordset")
rs.open "select classid,test,title,hu_author,hu_date from 74hu_article",myconn,1,3
rs.addnew
rs("classid")=id
rs("test")=test
rs("title")=title
rs("HU_date")=time_now
rs("HU_author")=author
rs.update
rs.close
set rs=nothing
w "记录添加成功!"
%><br/>----------<br/>
<a href="adminsmscl.asp?sid=<%=sid%>&amp;id=<%=id%>">[返回文章]</a><br/>
<a href="wzclass.asp?sid=<%=sid%>">[文章分类]</a><%Call Last2%>